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