UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CGzi4VMZ2w2FkhxNCOM8Jscp7i4P/msinUTadIlsWLE='
WHERE
key_id = '11aff3410aadab4f8a4faedd370dff11adc9d2ae21370beb3ed089b5dcdb454b'
AND (
token = 'CGzi4VMZ2w2FkhxNCOM8Jscp7i4P/msinUTadIlsWLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)