UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xcJBa+X25ixJNS0JPoEsNgHnhGIsIIQxW/Zsp65nmAE='
WHERE
key_id = '9a29311fa9bb1d33853cbb0b8ce5b9278d1ee5ae917825110582ea1ff308630d'
AND (
token = 'xcJBa+X25ixJNS0JPoEsNgHnhGIsIIQxW/Zsp65nmAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)