UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DSVYkZUSvmWOGJbjlU49MY9IHf11AmR5qGplwzXH2pY=' 
WHERE 
  key_id = '0b86ac6e8761f1d1f2407d88d7008eebb485f74d6d0749289ca52767d7309333' 
  AND (
    token = 'DSVYkZUSvmWOGJbjlU49MY9IHf11AmR5qGplwzXH2pY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034