UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4Q/Mh9Q4cuiTQKFChVePhdR2RC24zWwnyMeCZ6BA1c=' 
WHERE 
  key_id = '6a65ff8177eb98ab2ce374379a7c70778b7d4de0df2d0cc9c5fec52b2c0b09a0' 
  AND (
    token = 'Q4Q/Mh9Q4cuiTQKFChVePhdR2RC24zWwnyMeCZ6BA1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019