UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'js243Xm7fOmOSwiDPDpB40c7NJPBzoe5yfc3ZP1l+7U='
WHERE
key_id = 'becfee182a37ffd6596087a7a3922de764aac9d8c8a8a7fdb267fd7d8c66e7fb'
AND (
token = 'js243Xm7fOmOSwiDPDpB40c7NJPBzoe5yfc3ZP1l+7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)