UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NC+ezLUimfUak68zLShB4OuYKQkuWpYfHOJpszWtR0s=' 
WHERE 
  key_id = 'e0c03c090d0489e5bda9d971b3f2eb264bebe4f90dfdfd155bc1d7bfda358ade' 
  AND (
    token = 'NC+ezLUimfUak68zLShB4OuYKQkuWpYfHOJpszWtR0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039