UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LmyzbjvWJZKgDXS8M2As0h5SRbsJI07VnysnmSoxxqI='
WHERE
key_id = 'bb7061321012719bd3af93428785fe47fdb65fae77a28de5fd706b897852f8ba'
AND (
token = 'LmyzbjvWJZKgDXS8M2As0h5SRbsJI07VnysnmSoxxqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)