UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sI+4hwGrtpPXxsltkiF2j87214FjVeYcOpDggUfReLc='
WHERE
key_id = '7c7e395ae2b5103048ad1d08cc9721e7da37809d98aac108762f2417cb96e932'
AND (
token = 'sI+4hwGrtpPXxsltkiF2j87214FjVeYcOpDggUfReLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)