UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b6IlSUbaMMbVmIF00ExDcn6ViM3vCKvVOYye0UH+ydA='
WHERE
key_id = 'ea973c8d1f98969a6b3f9641e2c33db30fca5197202513e7029174c92f9e57b0'
AND (
token = 'b6IlSUbaMMbVmIF00ExDcn6ViM3vCKvVOYye0UH+ydA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)