UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DafZB2FWGe4eDD1b2UgWQEPxH7JvIX3LmtnilQuW8M='
WHERE
key_id = '4be9411fdae4a63c123f71946986c9988522188e1e8483f5c4cdf74e14b7e1c8'
AND (
token = '3DafZB2FWGe4eDD1b2UgWQEPxH7JvIX3LmtnilQuW8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)