UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UVhExZfHqssiz0dpW8kFarKZsj92fMwINelHj9xuYbU=' 
WHERE 
  key_id = '443c4c46e7ca48da4975f82f03d94d018a6c5fbfb50da7bdaa8964752169e1d8' 
  AND (
    token = 'UVhExZfHqssiz0dpW8kFarKZsj92fMwINelHj9xuYbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044