UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rcq0LdwYk6dKWI1kEB2u8obvXYNzCBku0y/+a0426s0=' 
WHERE 
  key_id = '890935b5f1fd0d54bd085870ba00f938c14c98f845f6c6e28fa8c2ebb31f8914' 
  AND (
    token = 'Rcq0LdwYk6dKWI1kEB2u8obvXYNzCBku0y/+a0426s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031