UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E80S8GQcTcZh/seF+swGU32Y4M06UtgNciUcad52B+A=' 
WHERE 
  key_id = '7ca849b6640cfd9ae8c035d454aadbbf285b834bd992d6caad75680a3008a293' 
  AND (
    token = 'E80S8GQcTcZh/seF+swGU32Y4M06UtgNciUcad52B+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037