UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zaP266G959t9l1iRqE7JJD7Byv3po4Af5/WBC3omW5c=' 
WHERE 
  key_id = '543a3c3b5c59e226bb14960d2b0a80afd9ad763cface7973bb0e57bf1decd7b7' 
  AND (
    token = 'zaP266G959t9l1iRqE7JJD7Byv3po4Af5/WBC3omW5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028