UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6aeu1Fu6Dn7q18P+y/ku4zTSoOSRgbhJfroEkewChQ='
WHERE
key_id = '017dea70d899249af895ee789c5519679e018f06e06729608a34c7881ffaecb2'
AND (
token = 'Z6aeu1Fu6Dn7q18P+y/ku4zTSoOSRgbhJfroEkewChQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)