UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nQ9B7xDDWzSuNGgdQa9pCwFofy0SU8nz5ayp9JsIVR4='
WHERE
key_id = '4f8e06c73a3b1af79c97804ee697c029eb83ee15fb93896dca992e101a79f2b0'
AND (
token = 'nQ9B7xDDWzSuNGgdQa9pCwFofy0SU8nz5ayp9JsIVR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)