UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PM+oFG2rRDUw89Ea1eVwyb5whjvOiqrXXZVB0qt1xmQ='
WHERE
key_id = '16fc1e540448471143a8aa37be715d077548a4f6853abe84bcf8390903122b7a'
AND (
token = 'PM+oFG2rRDUw89Ea1eVwyb5whjvOiqrXXZVB0qt1xmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)