UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kQNLCh4cTXpXUlRQk3dhRN9YGFCgi9xkjis5q942s/Q=' 
WHERE 
  key_id = '561da7ba8731c9613c3f3a4496fc6ccaa4efe2e65bca2a4fa67fd4718c17588c' 
  AND (
    token = 'kQNLCh4cTXpXUlRQk3dhRN9YGFCgi9xkjis5q942s/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018