UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rpU/ljRmPo4FPDRkOYLD37ofCe/5zC6WCPT/je1OYTI=' 
WHERE 
  key_id = '58a35c19cabf4d59a229a4861d65c9c58ef194baf08e6fdf991c4740e809220a' 
  AND (
    token = 'rpU/ljRmPo4FPDRkOYLD37ofCe/5zC6WCPT/je1OYTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059