UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OIYhL924ycqs+nPUrWVq2LAC2llVPLm41KdBLFc9HLw='
WHERE
key_id = '4b10934c106c040a2ec36ba074d5e3304b50949d1aa29c67d0c7a0a83f2a7103'
AND (
token = 'OIYhL924ycqs+nPUrWVq2LAC2llVPLm41KdBLFc9HLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)