UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4hQJ3S1gmHTN88a+IeC/UdmSxyrhykL9+s5kkHE3yVo='
WHERE
key_id = '3a94115fd16e5083a992797acb791bf9420c2d031e10709aee316d522efba2d2'
AND (
token = '4hQJ3S1gmHTN88a+IeC/UdmSxyrhykL9+s5kkHE3yVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)