UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nOyzZVmDQFiFlaBNQK7ukn/tEODe7xrLuE90EacdKEs='
WHERE
key_id = '8538d8efb7a9ed4edab8bb3fabb7cc76a902d9a5d2f868716e59c8884011fc81'
AND (
token = 'nOyzZVmDQFiFlaBNQK7ukn/tEODe7xrLuE90EacdKEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)