UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IKmNRlooHd8Wek28ogpZbxqJ6mGDDVm/Nq1wpSfiRZI='
WHERE
key_id = '2a47faacf3cf2119b746fd1d32fb5cc559b36afbdebb537f749b0b6daabf2c56'
AND (
token = 'IKmNRlooHd8Wek28ogpZbxqJ6mGDDVm/Nq1wpSfiRZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)