UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ylaImTTaLSvdcELkS6DNJ7GnL46CiUBYKB13VIWnh/c=' 
WHERE 
  key_id = 'c89fb531ec07f3c535d7e5ea9d6bd47c8c9f3d478fcdff28bd9bacf82ee5e3e4' 
  AND (
    token = 'ylaImTTaLSvdcELkS6DNJ7GnL46CiUBYKB13VIWnh/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033