UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZRM1sU4fe8h9ebf1rU1Vg9ZPYzoOX+fC3oQh1LZR8E4=' 
WHERE 
  key_id = 'cebc7e9bb3c77f02540c4bf1b085da277fd25f6473a5bee5ad1de1f6e369b09a' 
  AND (
    token = 'ZRM1sU4fe8h9ebf1rU1Vg9ZPYzoOX+fC3oQh1LZR8E4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058