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