UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B8nMrcKBEHrnqECGvFkYfMuShsuPyXRvXCXnOBye/yk='
WHERE
key_id = '4155b496fdc0c29eb60c692820630fe4644884bfb795f30168f66cf5493acd79'
AND (
token = 'B8nMrcKBEHrnqECGvFkYfMuShsuPyXRvXCXnOBye/yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)