UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqFfwLVO5EPXVy1kfYRNsYoTRW/Vb9MsoFj2DODIC2U=' 
WHERE 
  key_id = '64ca52af3420ea86af085bfa2c15d880897546f959e9973480c75d1522b4ac87' 
  AND (
    token = 'dqFfwLVO5EPXVy1kfYRNsYoTRW/Vb9MsoFj2DODIC2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027