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