UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X2k1ZPupxWAdZu/mWZlIQlvxkhasPnOXrue3kwda5Dk='
WHERE
key_id = '9de0d525b480c0ef972aaf20d337384ba8aee61546c822f70f2bcae5d53bbfad'
AND (
token = 'X2k1ZPupxWAdZu/mWZlIQlvxkhasPnOXrue3kwda5Dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)