UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OohJ57Wil7Dj4pDkkZIo0AYZ6j+VlQeEr7txMY+8s3g='
WHERE
key_id = '08b6209c27a0cefb4a44de025c8fdc253a9f77df736543af996fdc7d0fe5201a'
AND (
token = 'OohJ57Wil7Dj4pDkkZIo0AYZ6j+VlQeEr7txMY+8s3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)