UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SxWpNkUlIhbhkx1pm3k++QWbG/+yX5hSuARh1G/i3GQ='
WHERE
key_id = 'eea4f23e329b04892dc4338eb5ea16dfb1e27e8b62c1f0b084d0f8c8e1584cfc'
AND (
token = 'SxWpNkUlIhbhkx1pm3k++QWbG/+yX5hSuARh1G/i3GQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)