UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70aVgNvUTiwbYbi3R2IrL+q1BGpXsZCQPV6Pkkw7p3w='
WHERE
key_id = 'a273426e5c972c2267764cab9701c80994121201c477b631b04bd73500bea6c4'
AND (
token = '70aVgNvUTiwbYbi3R2IrL+q1BGpXsZCQPV6Pkkw7p3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)